<template>
  <div>
    <div id="chart" style="width: 100%;height: 350px"></div>
  </div>
</template>

<script>
import * as echarts from 'echarts';
  export default {
    mounted() {
      this.init();
    },
    methods: {
      init() {
        let dom = document.getElementById("chart");
        let chart = echarts.init(dom);
        chart.setOption(this.getOptions())
      },
      getOptions() {
        return {
          title: {
            text: '所有订单进度',
            left: 'center'
          },
          tooltip: {
            trigger: 'item'
          },
          legend: {
            orient: 'vertical',
            left: 'left'
          },
          series: [
            {
              name: '回收订单',
              type: 'pie',
              radius: '50%',
              data: [
                { value: 2, name: '待付款' },
                { value: 34, name: '待发货' },
                { value: 32, name: '待收货' },
                { value: 11, name: '待提现' },
                { value: 20, name: '已完成' }
              ],
              emphasis: {
                itemStyle: {
                  shadowBlur: 10,
                  shadowOffsetX: 0,
                  shadowColor: 'rgba(0, 0, 0, 0.5)'
                }
              }
            }
          ]
        }
      },
    }
  }
</script>

<style scoped lang="scss">

</style>
